package com.bdqn.demo.mapper;

import com.bdqn.demo.pojo.SysUser;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper {

    void insert(SysUser sysUser);

    void delete(Long id);

    void update(SysUser sysUser);

    @Select("select usr_id,usrName,usr_Password,usr_role_id,usr_flag"+"from sys_user where usr_id=#{id}")
    @Results({
            @Result(column = "usr_id",property = "usrId"),
            @Result(column = "usr_name",property = "usrName"),
            @Result(column = "usr_password",property = "usrPassword"),
            @Result(column = "usr_role_id",property = "usrRoleId"),
            @Result(column = "usrflag",property = "usrFlag")
    })

    SysUser get(Long id);

    List<SysUser> findAll();
}
